#ifndef AXMAPCONTROL_H
#define AXMAPCONTROL_H

#include <QWidget>
#include <QThread>
#include <QMutex>
#include "ui_axmapcontrol.h"
#include <../QGLViewer/qglviewer.h>
#include <vector>
#include "AxRangeReading.h"
using namespace std;

typedef struct
{
	GLfloat x;
	GLfloat y;
} vector_t;

typedef struct
{
	GLfloat x;
	GLfloat y;
	GLfloat z;
} vector3_t;

typedef vector<vector_t> scan_data_t;
typedef vector<scan_data_t> scans_t;

const double Default_mm_per_pixel = 10.0;

typedef vector<vector_t> Points;
typedef vector<vector3_t> Point3ds;
typedef vector<Points> Points_group;

class AxMapControl :  public QGLViewer
{
	Q_OBJECT

public:
	AxMapControl(QWidget *parent = 0);
	~AxMapControl();
	void set_plot_data(std::vector<ReadingPoint> pts,long timestamp);
	void set_plot_data(std::vector<ReadingPoint> pts,vector3_t pose,long timestamp);
	void clear_plot_data();
	void save();
	void redraw(void);
	struct pImpl;
	std::auto_ptr<pImpl> pimpl;
protected:
	virtual void draw();
	virtual void init();
	virtual QString helpString() const;
	
private:
	Ui::AxMapControl ui;
};

#endif // AXMAPCONTROL_H